package com.techsen.maven.plugins.version;

import java.io.File;
import java.io.FilenameFilter;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;

@Mojo(name = "clean")
public class CleanMojo extends AbstractScmMojo {
    @Override
    public void execute() throws MojoExecutionException {
        File[] files = this.basedir.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".bak");
            }
        });
        for(File file: files) {
            file.delete();
        }
    }
}
